<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            margin: 0;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #container {
            width: 800px;
            height: 600px;
            outline: 1px solid rgb(236, 10, 48);
        }
        #container h4 {
            text-align: center;
        }
        #container header {
            position: relative;
            width: 100%;
            height: 50px;
            border-top: 1px solid #aaa;
            border-bottom: 1px solid #aaa;
        }
        #container header .tab {
            float: left;
            width: 80px;
            height: 100%;
            position: relative;
            line-height: 50px;
            text-align: center;
            border-right: 1px solid #aaa;
        }
        .tab.active {
            border-bottom: 1px solid #fff;
        }
        #container header .tab>button {
            position: absolute;
            right: 0;
            top: 0;
        }
        #container header>button {
            position: absolute;
            width: 50px;
            height: 30px;
            right: 10px;
            top: 10px;
        }
    </style>
</head>
<body>
    <div id="container">
        <h4>Js 面向对象 动态添加标签页</h4>
        <header>
            <div class="tab active">
                1
                <button>×</button>
            </div>
            <div class="tab">
                2
                <button>×</button>
            </div>
            <div class="tab">
                3
                <button>×</button>
            </div>
            <div class="tab">
                4
                <button>×</button>
            </div>
            <button class="add-btn">新增</button>
        </header>
    </div>

    <script src="./js/index.js"></script>
</body>
</html>